package escritorio.Ui;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.border.BevelBorder;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class MainFrm extends JFrame {

	private JPanel contentPane;
	private JButton btnCadastrar;
	private JButton btnConsultar;
	private JButton btnSair;
	
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			@Override
			public void run() {
				try {
					MainFrm frame = new MainFrm();
					frame.setVisible(true);
					frame.setLocationRelativeTo(null);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public MainFrm() {
		setTitle("Controle e Gerenciamento Advocat\u00EDcio");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 469, 422);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		JPanel panelBotoes = new JPanel();
		panelBotoes.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));
		contentPane.add(panelBotoes, BorderLayout.NORTH);
		JButton btnCadastrar = new JButton("Cadastrar");
		JButton btnConsultar = new JButton("Consultar");
		JButton btnSair = new JButton("Sair");
		panelBotoes.add(btnCadastrar);
		panelBotoes.add(btnConsultar);
		panelBotoes.add(btnSair);
		
		
		btnSair.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				 System.exit(0);
			}
		});
		
		btnCadastrar.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				CadastroFrm frame = new CadastroFrm();
				frame.setVisible(true);
			}
		});
		
		
		JPanel panelLogo = new JPanel();
		panelLogo.setBackground(Color.WHITE);
		panelLogo.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
		contentPane.add(panelLogo, BorderLayout.CENTER);
		
		JLabel lblIcon = new JLabel("");
		lblIcon.setIcon(new ImageIcon("E:\\Downloads\\1292192712.png"));
		panelLogo.add(lblIcon);
	}

}
